package com.example.demo;

import com.baomidou.mybatisplus.generator.FastAutoGenerator;

import java.nio.file.Paths;

public class CodeGenerator {
    public static void main(String[] args) {
        FastAutoGenerator.create("jdbc:mysql://localhost:3306/demo?useUnicode=true&characterEncoding=UTF8", "root", "123456")
                .globalConfig(builder -> builder
                        .author("niejun")
//                        .enableSwagger()
                        .outputDir(Paths.get(System.getProperty("user.dir")) + "/src/main/java/code")
                )
                .packageConfig(builder -> builder
                        .parent("com.example.demo")
                )
                .strategyConfig(builder -> builder
                        .entityBuilder()
                        .enableLombok()
                )
                .execute();
    }
}
